﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Radar
{
    public partial class FormAntenquay : Form
    {
        Radar _radar;
        List<Coordinate> qd1 = new List<Coordinate>();
        System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();

        int speed = 300;
        public static List<FlyingItem> listTarget = new List<FlyingItem>();
        public static List<Rocket> listTenlua = new List<Rocket>();
        public static float culy;
        public static float phuongvi;
        public FormAntenquay()
        {
            InitializeComponent();
        }

        private void FormAntenquay_Load(object sender, EventArgs e)
        {
            _radar = new Radar(pictureBox1.Width, 344, 50, 285,5);
            _radar.numberOfSpirals = 3;
            _radar.Sovongtron = 5;
            pictureBox1.Image = _radar.Image;
            _radar.ImageUpdate += new ImageUpdateHandler(_radar_ImageUpdate);
            _radar.DrawScanInterval = speed/20;
            //txtMaxAngle.Text = _radar.maxAngle.ToString();

            //trackBarSpeed.Maximum = 20;
            //trackBarSpeed.TickFrequency = 1;
            //pQuetThang.Image = _radar.outputImageStraightSweep;
            //pQuetVong.Image = _radar.outputImageCircleSweep;
            //pXoanOc.Image = _radar.outputImageSpiralSweep;
        }
        void _radar_ImageUpdate(object sender, ImageUpdateEventArgs e)
        {
            pictureBox1.Image = e.Image;            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            _radar.DrawScanInterval = (speed) / 5;
            _radar.ImageUpdate += new ImageUpdateHandler(_radar_ImageUpdate);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            _radar.DrawScanInterval = (speed) / 10;
            _radar.ImageUpdate += new ImageUpdateHandler(_radar_ImageUpdate);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            _radar.DrawScanInterval = (speed)/20;
            _radar.ImageUpdate += new ImageUpdateHandler(_radar_ImageUpdate);
        }

    }
}
